<template>
    <!-- <view style="padding: 20px">
        <up-form :rules="rules" labelWidth="70" :model="userInfo" ref="form1">
            <up-form-item label="看板编号" prop="name">
                <up-input
                    placeholder="请输入想看看板的编号"
                    v-model="userInfo.name"
                />
            </up-form-item>
        </up-form>
        <up-button
            style="margin-top: 20px"
            type="primary"
            size="small"
            text="确定"
            @click="goWeb"
        />
    </view> -->
</template>

<script setup lang="ts">
import { ref } from 'vue'

const rules = {
    name: [
        {
            required: true,
            message: '此为必填字段',
            // blur和change事件触发检验
            trigger: ['blur', 'change'],
        },
        {
            pattern: /^[0-9]*$/g,
            // 正则检验前先将值转为字符串
            transform(value: any) {
                return String(value)
            },
            message: '只能包含数字',
        },
    ],
}
const form1 = ref<any>(null)
const userInfo = ref({ name: '' })
const goWeb = async () => {
    await form1.value?.validate()
    const tem = userInfo.value.name
    if (!tem) return
    uni.navigateTo({ url: `/pages/chart/chart?tem=${tem}` })
}
</script>

<style></style>
